#include "board.h"
#include "BoardTextViewer.h"
#include <assert.h>
void BoardTextViewer::draw(Board& board)
{
    assert((Board::ROWS < 27) && (Board::COLS < 10));
    int r,c;
    output_ << "\n ";
    for(c = 1; c!= Board::ROWS + 1; ++c)
        output_ << ' ' << c;
     
    output_ << "\n";
    output_ << " ";
    
    for(c = 1; c!= Board::ROWS + 1; ++c)
        output_ << "--";
    
    for(r = 1; r != Board::ROWS + 1; ++r){
        output_ << '\n' << char('a'+r-1) << '|';
        for(c = 1; c != Board::COLS + 1; ++c){
            if(board(r,c) == White){
                output_ << " o";
            }
            else if(board(r, c) == Black){
                output_ << " *";
            }
            else{
                output_ << "  ";
            }
        }
    }
    output_ << "\n[Black(*): " << board.score(Black)
             << "   White(o): " << board.score(White)
             << " ]\n\n";
}

                
